<!DOCTYPE html>
<html>
<head>
<title>登记确认</title>
<meta name="viewport"
	content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no">
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<meta name="format-detection" content="telephone=no">
<meta name="renderer" content="webkit">
<meta http-equiv="Cache-Control" content="no-siteapp" />
<link rel="stylesheet" href="assets/css/amazeui.min.css" />
<script src="assets/js/jquery.min.js" type="text/javascript"></script>
<script src="assets/js/amazeui.min.js" type="text/javascript"></script>
<script src="js/main.js" type="text/javascript"></script>
<script src="js/md5.js" type="text/javascript"></script>
<script type="text/javascript">
	$(function() {
		initValue();
	});
	function initValue() {
		register1Info();
		register2Info();
		register3Info();
	}
	function register1Info() {
		var register1 = window.sessionStorage.getItem('register1');
		var param1 = JSON.parse(register1);
		if (param1) {		
			$("#merchantname").append(param1.merchantname);
			$("#musername").append(param1.musername);
			$("#phone").append(param1.phone);
			$("#address").append(param1.address);
			$("#daymaxspray").append(param1.daymaxspray);
			$("#spraystation").append(param1.spraystation);
			$("#restway").append(param1.restway);
			//$("#licenseurl").append(param1.licenseurl);
			//$("#merchantphotos").append(param1.merchantphotos);
		}

	}
	function register2Info() {
		var register2 = window.sessionStorage.getItem('register2');
		console.log(register2);
		if (register2) {
			var obj = JSON.parse(register2);
			if(obj.commonpaint){
				DetailCarService('commonpaint', obj.commonpaint);
			}
			if(obj.mediumpaint){
				DetailCarService('mediumpaint', obj.mediumpaint);
			}
			if(obj.advancedpaint){
				DetailCarService('advancedpaint', obj.advancedpaint);
			}
			
			
		}
	}
	function register3Info() {
		var register3 = window.sessionStorage.getItem('register3');
		console.log(register3);
		if (register3&&register3!='undefined') {
			var param1 = JSON.parse(register3);
			$("#settlementdays").append(param1.settlementdays);
			$("#settlecard").append(param1.settlecard);
			$("#settlebankname").append(param1.settlebankname);
			$("#settleusername").append(param1.settleusername);
			$("#isservice").append(transferFlagValue(param1.isservice));
			$("#isfastpaint").append(transferFlagValue(param1.isfastpaint));
			$("#istakecar").append(transferFlagValue(param1.istakecar));	
		}
	}
	function DetailCarService(domid, carType) {
		if (carType) {
			$carObj = $("#" + domid);
			var singlepaintprices = carType.singlepaintprices;
			var sheetmetalprices=carType.sheetmetalprices;
			var content = '<ul class="am-list">';
			$.each(singlepaintprices, function(key, value) {
				content += '<li class="am-g am-list-item-desced"><strong>'
						+ value.description + ':</strong>' + value.price
						+ '</li>';
			});
			content += '</ul>';
			$carObj.find("div[title='singlepaintprices']").append(content);
			content = '<ul class="am-list">';
			$.each(sheetmetalprices, function(key, value) {
				content += '<li class="am-g am-list-item-desced"><strong>'
						+ value.description + ':</strong>' + value.price
						+ '</li>';
			});
			content += '</ul>';
			$carObj.find("div[title='sheetmetalprices']").append(content);
			$carObj.find("li[title='paintbrand']").append(carType.paintbrandname);
			$carObj.find("li[title='ispaintpartly']").append(transferFlagValue(carType.ispaintpartly));
			$carObj.find("li[title='hasholidayprice']").append(transferFlagValue(carType.hasholidayprice));
			$carObj.find("li[title='hasfeewash']").append(transferFlagValue(carType.hasfeewash));
			$carObj.find("li[title='holidaydiscount']").append(carType.holidaydiscount);
		}
	}
	function doConfirm() {
		popLoading();
		var reqData = new RequestData('register4.action');
		var merchantid = window.sessionStorage.getItem("merchantid");
		if (merchantid) {
			reqData.merchantid = merchantid;
		} else {
			reqData.merchantid = "";
		}
		var jsonstr = JSON.stringify(reqData);
		$.ajax({
			cache : false,
			type : "POST",
			crossDomain : true,
			url : testUrl,
			data : jsonstr, //你的formid
			async : true,
			error : function(request) {
				closeLoading();
				alert("Connection error");
			},
			success : function(data) {
				var dataObj = eval("(" + data + ")");
				if (dataObj.ret == 1) {
					popAlert('提交成功!');
					setTimeout("toPage('index.html')",1000);
					//location.href = "index.html";
				}
				closeLoading();
			}

		});
	}
</script>
</head>

<body>
	<header data-am-widget="header" class="am-header am-header-default am-header-fixed">
		<div class="am-header-left am-header-nav">
			<a href="javascript: void(0)"  onclick="javascript:history.back()"> <i
				class="am-header-icon am-icon-chevron-left"></i> </a>
		</div>
		<h1 class="am-header-title">
			<a href="#title-link" class=""> 确认信息4/4 </a>
		</h1>
	</header>
	<div data-am-widget="tabs" class="am-tabs am-tabs-d2">
		<ul class="am-tabs-nav am-cf">
			<li class="am-active"><a href="[data-tab-panel-0]">基本信息</a>
			</li>
			<li class=""><a href="[data-tab-panel-1]">报价</a>
			</li>
			<li class=""><a href="[data-tab-panel-2]">结算</a>
			</li>
		</ul>
		<div class="am-tabs-bd">
			<div data-tab-panel-0 class="am-tab-panel am-active">
				<div data-am-widget="list_news"
					class="am-list-news am-list-news-default">
					<div class="am-list-news-bd">
						<ul class="am-list">
							<li class="am-g am-list-item-desced" id="merchantname">商户名称:</li>
							<li class="am-g am-list-item-desced" id="musername">用户名:</li>
							<li class="am-g am-list-item-desced" id="address">商户地址：</li>
							<li class="am-g am-list-item-desced" id="phone">电话：</li>
							<li class="am-g am-list-item-desced" id="spraystation">喷漆工位:</li>
							<li class="am-g am-list-item-desced" id="daymaxspray">每日最大可喷漆数:</li>
							<li class="am-g am-list-item-desced" id="restway">休息日:</li>
						<!--  <li class="am-g am-list-item-desced" id="licenseurl">营业执照：</li>
							<li class="am-g am-list-item-desced" id="merchantphotos">商家照片：</li>-->	
						</ul>
					</div>
				</div>
			</div>
			<div data-tab-panel-1 class="am-tab-panel ">
				<section data-am-widget="accordion"
					class="am-accordion am-accordion-gapped" data-am-accordion='{  }'>
					<dl class="am-accordion-item " id="commonpaint">
						<dt class="am-accordion-title">20万以下车型</dt>
						<dd class="am-accordion-bd am-collapse am-in">
							<div class="am-accordion-content">
								<div data-am-widget="list_news"
									class="am-list-news am-list-news-default">
									<div class="am-list-news-bd">
										<section class="am-panel am-panel-default">
											<header class="am-panel-hd">
												<h2 class="am-panel-title">
													<label for="name">单幅车漆价格</label>
												</h2>
											</header>
											<div class="am-panel-bd divcss5" title="singlepaintprices"></div>
										</section>
										<section class="am-panel am-panel-default">
											<header class="am-panel-hd">
												<h3 class="am-panel-title">
													<label for="name">铂金价格</label>
												</h3>
											</header>
											<div class="am-panel-bd" title="sheetmetalprices"></div>
										</section>
										<ul class="am-list">
											<li class="am-g am-list-item-desced" title="paintbrand"><strong>车漆品牌:</strong>
											</li>
											<li class="am-g am-list-item-desced" title="ispaintpartly"><strong>是否局部喷漆:</strong>:</li>
											<li class="am-g am-list-item-desced" title="hasholidayprice"><strong>是否分节假日不同价钱：</strong>
											</li>
											<li class="am-g am-list-item-desced" title="hasfeewash"><strong>是否包含免费洗车服务:</strong>
											</li>
											<li class="am-g am-list-item-desced" title="holidaydiscount"><strong>节假日价格折扣:</strong>
											</li>
										</ul>
									</div>
								</div>
							</div>
						</dd>
					</dl>
					<dl class="am-accordion-item" id="mediumpaint">
						<dt class="am-accordion-title">20万-40万车型</dt>
						<dd class="am-accordion-bd am-collapse ">
							<div class="am-accordion-content">
								<div data-am-widget="list_news"
									class="am-list-news am-list-news-default">
									<div class="am-list-news-bd">
										<section class="am-panel am-panel-default">
											<header class="am-panel-hd">
												<h2 class="am-panel-title">
													<label for="name">单幅车漆价格</label>
												</h2>
											</header>
											<div class="am-panel-bd divcss5" title="singlepaintprices"></div>
										</section>
										<section class="am-panel am-panel-default">
											<header class="am-panel-hd">
												<h3 class="am-panel-title">
													<label for="name">铂金价格</label>
												</h3>
											</header>
											<div class="am-panel-bd" title="sheetmetalprices"></div>
										</section>
										<ul class="am-list">
											<li class="am-g am-list-item-desced" title="paintbrand"><strong>车漆品牌:</strong>
											</li>
											<li class="am-g am-list-item-desced" title="ispaintpartly"><strong>是否局部喷漆:</strong>:</li>
											<li class="am-g am-list-item-desced" title="hasholidayprice"><strong>是否分节假日不同价钱：</strong>
											</li>
											<li class="am-g am-list-item-desced" title="hasfeewash"><strong>是否包含免费洗车服务:</strong>
											</li>
											<li class="am-g am-list-item-desced" title="holidaydiscount"><strong>节假日价格折扣:</strong>
											</li>
										</ul>
									</div>
								</div>
							</div>
						</dd>
					</dl>
					<dl class="am-accordion-item" id="advancedpaint">
						<dt class="am-accordion-title">40万以上车型</dt>
						<dd class="am-accordion-bd am-collapse ">
							<div class="am-accordion-content">
								<div data-am-widget="list_news"
									class="am-list-news am-list-news-default">
									<div class="am-list-news-bd">
										<section class="am-panel am-panel-default">
											<header class="am-panel-hd">
												<h2 class="am-panel-title">
													<label for="name">单幅车漆价格</label>
												</h2>
											</header>
											<div class="am-panel-bd divcss5" title="singlepaintprices"></div>
										</section>
										<section class="am-panel am-panel-default">
											<header class="am-panel-hd">
												<h3 class="am-panel-title">
													<label for="name">铂金价格</label>
												</h3>
											</header>
											<div class="am-panel-bd divcss5" title="sheetmetalprices"></div>
										</section>
										<ul class="am-list">
											<li class="am-g am-list-item-desced" title="paintbrand"><strong>车漆品牌:</strong>
											</li>
											<li class="am-g am-list-item-desced" title="ispaintpartly"><strong>是否局部喷漆:</strong>:</li>
											<li class="am-g am-list-item-desced" title="hasholidayprice"><strong>是否分节假日不同价钱：</strong>
											</li>
											<li class="am-g am-list-item-desced" title="hasfeewash"><strong>是否包含免费洗车服务:</strong>
											</li>
											<li class="am-g am-list-item-desced" title="holidaydiscount"><strong>节假日价格折扣:</strong>
											</li>
										</ul>
									</div>
								</div>
							</div>
						</dd>
					</dl>
				</section>
			</div>
			<div data-tab-panel-2 class="am-tab-panel ">
				<div data-am-widget="list_news"
					class="am-list-news am-list-news-default">
					<div class="am-list-news-bd">
						<ul class="am-list">
							<li class="am-g am-list-item-desced" id="settlementdays"><strong>结算日:</strong></li>
							<li class="am-g am-list-item-desced" id="settlecard"><strong>结算账户:</strong></li>
							<li class="am-g am-list-item-desced" id="settlebankname"><strong>结算银行:</strong></li>
							<li class="am-g am-list-item-desced" id="settleusername"><strong>账户名:</strong></li>
							<li class="am-g am-list-item-desced" id="isservice"><strong>无忧售后:</strong></li>
							<li class="am-g am-list-item-desced" id="isfastpaint"><strong>24小时快喷:</strong></li>
							<li class="am-g am-list-item-desced" id="istakecar"><strong>取送车服务:</strong></li>
						</ul>
					</div>
				</div>
			</div>
		</div>
	</div>
	<div class="am-form-group" style="padding-bottom: 2em">
		<div class="am-u-sm-6">
			<button type="button" onclick="history.back()"
				class="am-btn am-btn-secondary am-btn-block">返回修改</button>
		</div>
		<div class="am-u-sm-6">
			<button type="button" onclick="doConfirm()"
				class="am-btn am-btn-secondary  am-btn-block">确认无误提交</button>
		</div>
	</div>
</body>
</html>
